var n1=100;//基本数据类型
var n2=new Number();
var n3=new Number(300); //基本包装类型
console.log(n1,n2,n3);//100 [Number: 0] [Number: 300]
console.log(typeof n1,typeof n2,typeof n3);// number object object
console.log(n1+n3.valueOf(),n1+n3); //400
var n4=new Number(100);
var n5=new Number(100);

var b1=true;
var b2=new Boolean();
var b3=new Boolean(false);
var b4=new Boolean(true);
var b5=new Boolean(true);
console.log(b1,typeof b1); //true boolean
console.log(b2,typeof b2);//[Boolean；false] object
console.log(b1==b4,b4==b5);//true false
console.log(b1===b4,b4===b5);//false false

// object-->boolean
var a1=b3.valueOf();
var a2=Boolean(b3);  //显式的数据类型转换 object-->boolean  true

var a3=Boolean(300);

console.log(a1,a2,a3); //false true true
console.log(typeof a1,typeof a2,typeof a3); //boolean boolean boolean
// new String string-->object

var str1='hello';
var str2=new String();
var str3=new String('hello');
var str4=new String('hello');
console.log(str1,typeof str1);//hello string
console.log(str2,typeof str2); //[String:''] object
console.log(str1==str3,str3==str4);//true false
//String string-->object
var v1=String(str4);
var v2=String(true);
var v3=String(null);
console.log(v1,v2,v3); //'hello' 'true''null'

//toString() string-->object
var n1=str4.toString();
console.log(n1,typeof n1); //'hello' string
var obj={id:1001,name:'zs'};
var n2=obj.toString();
console.log(n2,typeof n2);//[object object]

obj.toString=function(){
      return this.id+' '+this.name;
}  //toString的重写
var n3=obj.toString();
console.log(n3,typeof n3);//'1001 zs' string